<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>登陆</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<!--如果的值为空则不显示-->
<p  style="color:red;padding-left: 30%;padding-top: 50px" th:text="${msg}"  th:if="${not #strings.isEmpty(msg)}"></p>

<form class="form-horizontal" role="form" style="padding-left: 20%;padding-top: 100px;"  method="post" th:action="@{/login}">

    <div class="form-group">
        <label for="firstname" class="col-sm-2 control-label">账号</label>
        <div class="col-sm-3">
            <input type="text" class="form-control" id="firstname"
                   name="username"
                   placeholder="请输入账号">
        </div>
    </div>
    <div class="form-group">
        <label for="lastname" class="col-sm-2 control-label">密码</label>
        <div class="col-sm-3">
            <input type="password" class="form-control" id="lastname" name="password"
                   placeholder="请输入密码">
        </div>
    </div>

    <div class="form-group">
        <div class="col-sm-offset-2 col-sm-3">
            <button type="submit" class="btn btn-default">登录</button>
        </div>
    </div>
</form>
​


</body>
</html>